#ifndef CLIENT_H
#define CLIENT_H
#include <QWidget>
#include <QTcpSocket>
#include<QFile>
class Client : public QObject
{
    Q_OBJECT
public:
    Client(QObject *parent = nullptr);

    void connectToHost(const QString &hostname, quint16 port,const QString &username);//连接到主机
signals:
    void messageReceived(const QString &message);//消息接收信号


private slots:
    void handleReadyRead();//处理准备好读取的数据

private:
    QTcpSocket *socket;
    QFile *file;
    QString fileName;
};

#endif // CLIENT_H
